$('.sidebar-title').click(function(){
	$(this).addClass('active').siblings('.active').removeClass('active');
	
	 var id = $(this).children().children('a').attr('href');
  	$(id).addClass('active')
    .siblings('.active').removeClass('active');
    
    
//  点击一级菜单打开对应的二级菜单
    if($('.viewFramework-product').hasClass('viewFramework-product-col-1')==false){
    	$('.viewFramework-product').addClass('viewFramework-product-col-1');
    }
})

//二级菜单的折叠与展开
$('.product-navbar-collapse-inner').click(function(){
	$('.viewFramework-product').toggleClass('viewFramework-product-col-1');
})


//左侧一级菜单的折叠与展开
$('.sidebar-fold').click(function(){
	var full=$('.viewFramework-body')[0];
	if($(full).hasClass('viewFramework-sidebar-full')){
		$(full).removeClass('viewFramework-sidebar-full').addClass('viewFramework-sidebar-mini');
		$('.sidebar-title-inner').css('height','40px');
		$('.sidebar-title-icon').css('lineHeight','42px');
	}else if($(full).hasClass('viewFramework-sidebar-mini')){
		$(full).removeClass('viewFramework-sidebar-mini').addClass('viewFramework-sidebar-full');
	}
})
//为左侧菜单添加相应主体内容的的链接
$('#list_one>ul>li>div>a').click(function(e){
	e.preventDefault();
	var href=$(this).attr('href');
	var iframe=$('#ifr')[0].src=href;
})
$('.sidebar-nav>ul>li>a').click(function(e){
	e.preventDefault();
	var href=$(this).attr('href');
	var iframe=$('#ifr')[0].src=href;
})


$('#list_one>ul>li').click(function(){
	$('#list_one>ul>li').removeClass('active');
	$(this).addClass('active').siblings().removeClass('active');
})

//二级菜单的小图标折叠与展开是左右切换
$('.product-navbar-collapse-inner').click(function(){
	if($('.viewFramework-product').hasClass('viewFramework-product-col-1')==false){
		$(this).children('.product-navbar-collapse').children('span').removeClass('fa-angle-double-left').addClass('fa-angle-double-right');
	}else{
		$(this).children('.product-navbar-collapse').children('span').removeClass('fa-angle-double-right').addClass('fa-angle-double-left');
	}
})


//为左侧菜单添加上下折叠效果
$('.sidebar-title').click(function(){
	$(this).parent().toggleClass('sidebar-nav-fold');
	if($(this).parent().hasClass('sidebar-nav-fold')==false){
		$(this).css('backfround','#22282e');
	}
})


